package com.nulldev.util.net.experimental.groupedudp.client;

import java.net.UnknownHostException;

import com.nulldev.util.net.experimental.groupedudp.AGroupNetwork;

public class ClientGroupNetwork extends AGroupNetwork {
    /**
     * Prepares new GroupClientThread bound on interface of given hostAddress with given password and server address.
     * 
     * @param userName User's name in network
     * @param groupPassword Password required to access this group or null, if none
     * @param serverAddress Address of group owner
     * @param port Port of server socket
     * @throws UnknownHostException 
     */
    public ClientGroupNetwork(String userName, String groupPassword, String serverAddress, int port) throws UnknownHostException {
        this.groupThread = new GroupClientThread(userName, groupPassword, serverAddress, port);
    }
    
    /**
     *  Prepares new GroupClientThread with given password and default values loaded from configuration file.
     * 
     * @param userName User's name in network
     * @param groupPassword Password required to access this group or null, if none
     * @param serverAddress Address of group owner
     * @throws UnknownHostException 
     */
    public ClientGroupNetwork(String userName, String groupPassword, String serverAddress) throws UnknownHostException {
        this(userName, groupPassword, serverAddress, 52511);
    }
}
